
include build.env

all: build

build:: $(BUILD_ORDER)
	rm -rf output/*
	mkdir -p $(MAKEDIR_OUTPUT_LIST)
ifdef BUILD_ORDER
ifneq ($(BUILD_ORDER),)
	@for i in $(BUILD_ORDER); do \
	  make -C $$i || exit $$?; \
	done
endif
endif

clean::
	rm -rf output/*
	mkdir -p $(MAKEDIR_OUTPUT_LIST)
ifdef BUILD_ORDER
ifneq ($(BUILD_ORDER),)
	@for i in $(BUILD_ORDER); do \
	  make -C $$i clean || exit $$?; \
	done
endif
endif

distclean::
	make -C . clean
ifdef BUILD_ORDER
ifneq ($(BUILD_ORDER),)
	@for i in $(BUILD_ORDER); do \
	  make -C $$i distclean || exit $$?; \
	done
endif
endif

fullclean::
	make -C . distclean
ifdef BUILD_ORDER
ifneq ($(BUILD_ORDER),)
	@for i in $(BUILD_ORDER); do \
	  make -C $$i fullclean || exit $$?; \
	done
endif
endif
	rm -rf output config.db
